﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Customer.Master" AutoEventWireup="true"
    CodeBehind="CustomerEditOrder.aspx.cs" Inherits="EHTSaleManager.UICustomer.CustomerEditOrder" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table cellspacing="0" cellpadding="0" class="data-table">
        <tr>
            <td>
                <div class="accountInfo">
                    <fieldset class="login">
                        <legend>Order Infomation</legend>
                        <table>
                            <tbody>
                                <tr>
                                    <td colspan="3">
                                        <span class="failureNotification">
                                            <asp:Literal ID="ltrMessage" runat="server"></asp:Literal>
                                        </span>
                                        <asp:ValidationSummary ID="HistoryOfOrderSummary" runat="server" CssClass="failureNotification"
                                            ValidationGroup="HistoryOfOrderGroup" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbReceivedName" runat="server">Full Name:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtReceivedName" runat="server" CssClass="textEntry"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="rRegion" runat="server" ControlToValidate="txtReceivedName"
                                            ValidationGroup="HistoryOfOrderGroup" CssClass="failureNotification" ErrorMessage="Name is required."
                                            ToolTip="Name is required." Text="*" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbReceivedAddress" runat="server">Address:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtReceivedAddress" runat="server" CssClass="textEntry"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="rReceivedAddress" runat="server" ControlToValidate="txtReceivedAddress"
                                            ValidationGroup="HistoryOfOrderGroup" CssClass="failureNotification" ErrorMessage="Address is required."
                                            ToolTip="Address is required." Text="*" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbReceivedCity" runat="server">City:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtReceivedCity" runat="server" CssClass="textEntry"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="rReceivedCity" runat="server" ControlToValidate="txtReceivedCity"
                                            ValidationGroup="HistoryOfOrderGroup" CssClass="failureNotification" ErrorMessage="City is required."
                                            ToolTip="City is required." Text="*" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbReceivedRegion" runat="server" Text="Region:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlReceivedRegion" runat="server" CssClass="textEntry" OnDataBound="ddlReceivedRegion_DataBound">
                                        </asp:DropDownList>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbPostCode" runat="server">Post code:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtPostCode" runat="server" CssClass="textEntry" Text=""></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="rPostCode" runat="server" ControlToValidate="txtPostCode"
                                            ValidationGroup="HistoryOfOrderGroup" CssClass="failureNotification" ErrorMessage="Post code is required."
                                            ToolTip="Post code is required." Text="*" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbReceicedPhone" runat="server">Phone:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtReceicedPhone" runat="server" CssClass="textEntry" Text=""></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:RequiredFieldValidator ID="rReceicedPhone" runat="server" ControlToValidate="txtReceicedPhone"
                                            ValidationGroup="HistoryOfOrderGroup" CssClass="failureNotification" ErrorMessage="Phone is required."
                                            ToolTip="Phone is required." Text="*" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbRequredDate" runat="server">Requred Date:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:Calendar ID="cdRequredDate" runat="server"></asp:Calendar>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblServiceCost" runat="server">Service Cost:</asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblServiceCostValue" runat="server" />
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </fieldset>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <fieldset>
                    <legend>Order Details</legend>
                    <asp:Repeater ID="rOrderDetails" runat="server" OnItemCommand="rOrderDetails_ItemCommand"
                        OnItemDataBound="rOrderDetails_ItemDataBound">
                        <HeaderTemplate>
                            <table cellspacing="0" cellpadding="0" class="data-table">
                                <thead>
                                    <tr>
                                        <th id="tdTitleDelete" runat="server" class="actions delete">
                                            Delete
                                        </th>
                                        <th>
                                            Product Name
                                        </th>
                                        <th>
                                            Unit Price
                                        </th>
                                        <th>
                                            Quantity
                                        </th>
                                        <th>
                                            Discount
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td id="tdActionDelete" runat="server" class="actions delete">
                                    <asp:ImageButton ID="ibtnDelete" runat="server" ImageUrl="~/Styles/Delete.png" CommandArgument='<%#Eval("ID") %>'
                                        CommandName="DeleteOrderDetail" OnClientClick="return confirm('Are you sure you want to delete this Product in Order?');" />
                                </td>
                                <th>
                                    <%#Eval("ProductName")%>
                                </th>
                                <td>
                                    <%#Eval("UnitPrice")%>
                                </td>
                                <td>
                                    <%#Eval("Quantity")%>
                                </td>
                                <td>
                                    <%#Eval("Discount")%>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </tbody> </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </fieldset>
            </td>
        </tr>
    </table>
    <p class="submitButton">
        <asp:Button ID="btnSave" runat="server" Text="Save Order Infomation" ValidationGroup="HistoryOfOrderGroup"
            OnClick="btnSave_Click" />
        <asp:Button ID="btnDelete" runat="server" Text="Delete this Order" ValidationGroup="HistoryOfOrderGroup"
            OnClick="btnDelete_Click" />
        <asp:Button ID="btnBack" runat="server" OnClick="btnBack_Click" Text="Back to History Of Order" />
    </p>
</asp:Content>
